Part Number Hot Search : 
PL002 2N3558 MPG3363K TOM9308 SNC11905 BZ526 ADA496 4052A
Product Description
Full Text Search
 

To Download AN538 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  application note st75c502 - bulk delay management AN538/0695 1 - introduction the purpose of this application note is to describe the way the user must handle the interrupt reserved for bulk delay managment. a v.32bis modem use echo canceller technology, it substract from its received signal an estimation of its own signal echoed by the pstn. as the transmition can have a very long delay, especialy while using satellite (up to 1.4 second), its is m andatory to memorise all the signal that have been send during the last 1.4 second. to reduce the size of the memory needed, instead of storing the signal, we just store the symbols that were transmitted. however one can see that, if we want to handle two satellites hops, it is necessary to have a 1.4 second * 2400 symbols by second = 3360 symbols. each symbol can be packed using a single byte, so the size of this bulk memory is 3360 bytes. in the st75c502, instead of adding a 4k byte inside the dsp, just to be used like a fifo, to store and recall one symbol (byte) each baud (0.4ms), the bulk delay can be implemented using the host interface memory. we assume that the host processor have enough memory to allocate a 4k byte inside its own data memory. 2 - initialization prior to any operation, the user must assign the bulk delay (bulk_delay_line) inside its data space. the length of the bulk delay is depending of the maximum round trip delay (max_bulk_delay) that we want to handle. #define max_bulk_delay 3360 /* 1.4 second maximum roud trip delay */ unsigned char bulk_delay_line[max_bulk_delay]; /* symbols storage area */ code : 1 /* "c" global declaration */ for further understanding we define few prototype functions : - st75c5x_read: read a dual ram location. - st75c5x_write: write a dual ram location. - st75c5x_send_cci_command: send a cci command to the st75c502. /* read a dual ram location: return code is the contain of the ram */ unsigned char st75c5x_read(unsigned char address); /* write a dualram location: write data at address */ void st75c5x_write(unsigned char address, unsigned char data); /* send a cci co mmand to the st75c502 */ unsigned char st75c5x_send_cci_command(unsigned char opcode, unsigned char param[4]); 1/4
code : 2 /* "c" prototype function */ an example of implementation of st75c5x_send_cci_command is given at the end of this application note. the mechanism implemented inside the st75c502 assumes that the address of the bulk_delay_line is a 16 bit word (short int) and that each byte of the bulk_delay_line are located continiously (+1). at the begining we must initialize this mechanism by giving it the two addresses ba_addr and to_addr . we assume that the "c" compiler contains two functions to convert a pointer into its physical address and an address (as a short int) into a pointer. let define these two prototypes: /* convert a pointer into a physical address */ short int ptr_addr( unsigned char *var); /* convert a physical address into a pointer */ unsigned char *addr_ptr( short int var); code : 3 /* "c" pointer to interger conversion prototype */ after the conf command used to select the v.32bis mode of operation, we have to initialize the bulk delay mechanism with a bulk command: /* global declaration */ #define cci_bulk 0x22 /* cci bulk opcode */ unsigned char st75c5x_init_bulk() { /* local declaration */ short int i, base_addr, top_addr; unsigned char param[4]; /* get physical address for base of bulk_delay_line */ i = ptr_addr(&bulk_delay_line[0]); /* be sure this number is on a 8 bytes b oundary */ while ((i%8)!=0) i++; base_addr = i; /* get physical address for top of bulk_delay_line */ i = ptr_addr(&bulk_delay_line[max_bulk_delay-1]); /* be sure this number is on a 8 bytes b oundary */ while (((i+1)%8)!=0) i--; top_addr = i; /* prepare parameters for sending command */ param[0] =(unsigned char) base_addr % 256; param[1] =(unsigned char) base_addr > 8; param[2] =(unsigned char) to p_addr % 256; param[3] =(unsigned char) to p_addr > 8; /* send cci command */ return( st75c5x_send_cci_co mmand( cci_bulk, param )); } code : 4 /* "c" bulk initialization */ st75c502 - bulk delay managment 2/4
there is no particular timming to respect between the conf command, the hshk command and the bulk command. however, to work properly, the bulk command must be send before the echo canceller is started (ca-ac transition in answer mode, r1 detection in originate mode). we can also send the bulk command in other mode than v.32 (or v.32 autobaud) this will not have any effect. at that steep we must known if we want to proceed the bulk delay managment by pooling or by interrupt. as the interrupt task is very simple we recommand the use of an interrupt; however just pooling the symsta dual ram location will give the same results. if we use interrupt we must enable the interrupt bit inside the itmask register, this will allow the st75c502 to generate a signal on its sintr pin. /* enable st75c5x bulk interrupt */ #define addr_itmask 0x4f /* st75c5x interrupt mask */ #define dual_en_bulk_it 0x02 /* enable bulk interrupt bit */ void st75c5x_enable_bulk_it() { st75c5x_write(addr_itmask, st75c5x_read(addr_itmask) | dual_en_bulk _it)); } code : 5 /* "c" enable bulk interrupt */ 3 - main task each 8 symbols (3.3ms) it is mandatory to serve the bulk delay mechanism, otherwise an error occurs that will be signaled into the syserr bit 2 (err_sym) . the following routine is just the part of the interrupt mandatory to serve the bulk delay. its suppose that the interrupt (itsrcr) source have been correctely decoded and that the other interrupts (error, command, status, data_tx, data_rx) are well served. /* global declaration */ #define addr_symsta 0x0f /* symbol buffer status */ #define addr_symadt 0x10 /* symbol tx buffer pointer */ #define addr_symadr 0x12 /* symbol rx b uffer pointer */ #define addr_symbuf 0x14 /* symbol buffer */ #define addr_itsrcr 0x50 /* interrupt source byte */ #define dual_clr_it_bulk 0x41 /* clear it1 */ /* !!!! only part of the inter rupt !!!! */ /* local declaration */ short int addr; /* local address */ unsigned char *p; /* local pointer */ unsigneg char i; /* local loop counter */ /* read interrupt source */ if (st75c5x_read(addr_itsrcr)&dual_it_bulk)) { /**** the bulk service is required *****/ /* read first address */ addr=(short int) st75c5x_read(addr_symadr); addr+=(st 75c5x_read(addr_symadr+1)<8)); p=addr_ptr(addr); /* convert into a pointer */ /* move from dual ram to bulk_delay_line */ for (i=0;i<8;i++) st75c5x_write (addr_symbuf+i, *p++); /* clear the bulk interrupt pending bit */ st75c5x_write (dual_clr_it_bulk, 0); /* !!!! continu processing with the other interrupts !!!! */ code 6 : /* "c" interrupt bulk managment */ st75c502 - bulk delay managment 3/4
4 - appendix /* global definition of dual ram address */ #define addr_comsys 0x00 /* co mmand word */ #define addr_compar 0x01 /* parameters */ #define addr_syserr 0x08 /* error status */ /* optional: error return codes */ #define dual_err_nready 0x01 /* st75c5x not ready */ #define dual_err_iocd 0x02 /* incorrect opcode */ #define dual_err_iprm 0x04 /* incorrect parameter */ #define cci_err_mask 0x18 /* mask for iocd or iprm */ #define cci_err_maskio 0x08 /* mask for iocd */ /* send a cci co mmand to the st75c5x */ unsigned char st75c5x_send_cci_command( unsigned char opcode, unsigned char param[4]) { unsigned char i; /* local */ /* optional: test if the st75c5x is ready to execute a command */ if (st75c5x_read(addr_comsys)!=0x00) return(dual_err_nready); /* write parameters */ for (i=0;i<=3;i++) st75c5x_write(addr_compar+i, param[i]); /* last write opcode to start transfer */ st75c5x_write(addr_comsys, opcode); /* wait until comsys empty */ while (st75c5x_read(addr_comsys)!=0x00) /* wait */; /* optional: read the error status to check if the co mmand was suc cessfull */ i = (st75c5x_read(addr_syserr)&cci_err_mask); /* optional: test if cci error */ if (i!=0) { if (i&cci_err_maskio) re turn(dual_err_iocd); else return(dual_err_iprm); } return (0); } code : 7 /* "c" st75c5x_send_cci_command example of implementation */ information furnished is believed to be accurate and reliable. however, sgs-thomson microelectronics assumes no responsibility for the consequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. no licence is granted by implication or otherwise under any patent or patent rights of sgs-thomson microelectroni cs. specifications mentioned in this publication are subject to change without notice. this publication supersedes and replaces all information previously supplied. sgs-thomson microelectronics products are not authorized for use as critical components in lif e support devices or systems without express written approval of sgs-thomson microelectronics. ? 1995 sgs-thomson microelectronics - all rights reserved purchase of i 2 c components of sgs-thomson microelectronics, conveys a license under the philips i 2 c patent. rights to use these components in a i 2 c system, is granted provided that the system conforms to the i 2 c standard specifications as defined by philips. sgs-thomson microelectronics group of companies australia - brazil - china - france - germany - hong kong - i taly - japan - korea - malaysia - malta - morocco the netherlands - singapore - spain - sweden - switzerland - taiwan - thailand - united kingdom - u.s.a. st75c502 - bulk delay managment 4/4


▲Up To Search▲   

 
Price & Availability of AN538

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X